#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：Employment_class 
@File    ：03_练习.py
@IDE     ：PyCharm 
@Author  ：XiaoDengYa
@Date    ：2021/7/27/027 20:51 
"""
import re

"""
http://www.interoem.com/messageinfo.asp?id=35
http://3995503.com/class/class09/news_show.asp?id=14
http://lib.wzmc.edu.cn/news/onews.asp?id=769
http://www.zy-ls.com/alfx.asp?newsid=377&id=6
http://www.fincm.com/newslist.asp?id=415

需要 正则后为：
http://www.interoem.com/
http://3995503.com/
http://lib.wzmc.edu.cn/
http://www.zy-ls.com/
http://www.fincm.com/
"""

# sub = """http://www.interoem.com/messageinfo.asp?id=35
# http://3995503.com/class/class09/news_show.asp?id=14
# http://lib.wzmc.edu.cn/news/onews.asp?id=769
# http://www.zy-ls.com/alfx.asp?newsid=377&id=6
# http://www.fincm.com/newslist.asp?id=415"""
#
# result = re.sub(r"(http://.+?/).*", lambda x: x.group(1), sub)
# print(result)

# 2. 找出单词
# 有一句英文如下：
#
# hello world ha ha
#
# 查找所有的单词

s = "hello world ha ha"

print(re.split(r" +",s))

print(re.findall(r"\b[a-zA-Z]+\b",s))